#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File   : d_io_string_byte.py
# @Email  : xuexia_xu@feidee.com
# @Time   : 2024/4/2 13:34
# @Desc   : StringIO和BytesIO

# StringIO顾名思义就是在内存中读写str。


"""
>>> from io import StringIO
>>> f = StringIO()
>>> f.write('hello')
5
>>> f.write(' ')
1
>>> f.write('world!')
6
>>> print(f.getvalue())
hello world!
>>> f = StringIO('Hello!\\nHi!\\nGoodbye!')
>>> while True:
...     s = f.readline()
...     if s == '':
...         break
...     print(s.strip())
...
Hello!
Hi!
Goodbye!
"""

"""
>>> from io import StringIO

"""